<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/axios.min.js"></script>
    <script type="text/javascript" src="js/vue.js"></script>
    <script type="text/javascript" src="js/const.js"></script>
</head>
<body>
    <div id="app">
        <ul>
            <li>name</li>
            <li><input type="text" v-model="name"></li>
            <li>remark</li>
            <li><textarea rows="3" cols="50" v-model="remark"></textarea> </li>
            <li><button v-on:click="insert()">insert</button></li>
        </ul>
    </div>
</body>
<script type="text/javascript">
    var config = {
        el:"#app",
        data:{
            name:null,
            remark:null
        },
        methods:{
            insert:function(){
                var url = serverHost+"insert";
                var data = {
                    "name":this.name,
                    "remark":this.remark
                };
                axios.post(url,data).then(
                function(res){
                    location.href="goods.html";
                });
            }
        },
        mounted:function(){
        }
    };

    var vue = new Vue(config);
</script>
</html>